-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API for custom component theming with M3 #27617
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mmalerba
added
the
merge: preserve commits
When the PR is merged, a rebase and merge should be performed
label
Aug 10, 2023
mmalerba
force-pushed
the
m3-theming-api
branch
3 times, most recently
from
August 11, 2023 15:12
ba52651
to
74718a1
Compare
mmalerba
force-pushed
the
m3-theming-api
branch
from
August 11, 2023 15:12
74718a1
to
6d27dd3
Compare
andrewseguin
approved these changes
Aug 11, 2023
mmalerba
force-pushed
the
m3-theming-api
branch
from
August 14, 2023 20:06
8afc00e
to
32eedf7
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
action: merge
The PR is ready for merge by the caretaker
detected: feature
PR contains a feature commit
merge: preserve commits
When the PR is merged, a rebase and merge should be performed
target: major
This PR is targeted for the next major release
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A new API for this is necessary because the existing APIs (e.g.
mat.get-color-from-palette
) require the user to have some knowledge of how the theme object is structured. With the M3 theme objects, we made he decision that the theme object structure should be opaque to the user.I will do a followup PR to add support for using the same API to access values from M2 theme objects. This will allow users to move their custom components on to the new API before updating to use an M3 theme.
With the new theming APIs, I'm focusing on trying to catch common errors a user might make and report helpful error messages rather than the
$map: null is not a map
errors that our previous APIs often threw. I've added tests to cover these error cases as well as the expected cases.I'm introducing the APIs as private in this PR, but will do a followup once they have M2 theme support to make them public.